<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<button type="button" id="bclick" onclick="//dclick()">test</button>
		<div id="dclick" onclick="//dclick()" style="width: 100px;height: 100px;border: 1px solid blue;">
			
		</div>
	</body>
	<script type="text/javascript">
		// 1.按钮和DIV的单击事件（三种绑定方式）
		
		// button&div =>单击事件元素1
		// 	function dclick(){
		// 		console.log('绑定1')
		// 	}
		
		// button&div =>单击事件元素2
		// 	document.getElementById('bclick').onclick = function(){
		// 		console.log('绑定2')
		// 	};
		// 	document.getElementById('dclick').onclick = function(){
		// 		console.log('绑定2')
		// 	};
		
		//button&div =>单击事件元素3
			// document.getElementById('bclick').addEventListener('click',function(){console.log('绑定3')})
			// document.getElementById('dclick').addEventListener('click',function(){console.log('绑定3')})

	</script>
</html>
